<?php if (!$session->check('Auth.valid')): ?>
<div id="box-login">
	<?php echo $form->create('User', array('url' => array('controller' => 'users', 'action' => 'login'))); ?>
	<?php echo $form->input('User.username', array('label' => __('Correo electrónico', true))); ?>
	<?php echo $form->input('User.password', array('label' => __('Contraseña', true))); ?>
	<?php echo $form->submit(__('Iniciar sesión', true), array('div' => false)); ?>
	<?php echo $form->checkbox('remember', array('label' => __('Recordar datos', true))); ?>
	<?php echo $html->link(__('¿Olvidaste tu clave?', true), array('controller' => 'users', 'action' => 'forgot_pw')); ?>
	<?php echo $form->end(); ?>
</div>
<?php endif; ?>

<div id="head">
	<div class="wrapper">
		<div class="control-user">
		<?php if ($session->check('Auth.valid')): ?>
			<p class="image"><?php echo $html->image(($session->check('Auth.Profile.profile') ? $session->check('Auth.Profile.avatar_medium') : '/media/profile-medium.gif'), array('width' => 48, 'height' => 48, 'class' => 'photo', 'alt' => $session->read('Auth.Profile.name'))); ?></p>
			<p class="name">
				<?php echo $html->link($session->read('Auth.Profile.name'), array('controller' => 'users', 'action' => 'profile')); ?> | 
				<?php echo $html->link(__('Tu cuenta', true), array('controller' => 'users', 'action' => 'settings')); ?>
			</p>
			<p class="link">
				<!-- <?php //echo $html->link(__('¿Cómo funciona?', true), array('controller' => 'pages', 'action' => 'display', 'how-it-works')); ?> -->
				<?php echo $html->link(__('Salir', true), array('controller' => 'users', 'action' => 'logout')); ?>
			</p>
		<?php else: ?>
			<p class="link">
				<?php echo $html->link(__('¿Que es Plasa?', true), array('controller' => 'pages', 'action' => 'display', 'how-it-works')); ?>
				<?php //echo $html->link(__('Únete', true), array('controller' => 'users', 'action' => 'signup')); ?>
				<?php echo $html->link(__('Ingresa o Regístrate', true), array('controller' => 'users', 'action' => 'login'), array('id' => 'btn-box-login')); ?>
			</p>
		<?php endif; ?> 
		</div>
		
		<?php echo $html->link(Configure::read('Site.description'), array('controller' => 'home', 'action' => 'index'), array('class' => 'logo')); ?>
		
	</div>
</div>
